% Estimate compression ratio of a frame.
% Return (compressed size) / (original size)
% Arguments:
%   data: RGB representation of a frame
function [ratio] = CompRatio(data)
    % Quantitize to 256 colors
    [reduced,map]= rgb2ind(data,256);
    % Denoise
    reduced = medfilt2(reduced,[3,3]);
    
    % Compress data and calculate the compression ratio
    compData = dzip(reduced);
    data = data(:);
    ratio = size(compData)/size(data);